package org.example.异常;

import java.io.IOException;

/**
 * @author mumucgq
 * @create 2020-07-22 11:22
 */
public class finallyTest {
    public static void main(String[] args) {
        int i=test();
        System.out.println(i);
    }
    public static int test(){
        try{

            throw new IOException("try 中发生异常");
        } catch (IOException e) {
//            e.printStackTrace();
            System.out.println("处理 try中的异常");
        } finally {
            System.out.println("发生异常前");
            try {
                int i=1/0;
            }catch (Exception e){
                System.out.println("finally 中发生的异常");
            }
            System.out.println("发生异常后");
            return 10;
        }
//        return 10;
    }
}
